<template lang="">
  <div class="_flex-y _p10">
    <div class="_flex _flex-space _cart _p5 _m-b-5">
      <el-input
        v-model="siteMn"
        placeholder="请输入mn编号"
        :disabled="!!comCode"
      ></el-input>
      <el-input v-model="dayNum" placeholder="请输入查询天数"></el-input>
      <el-button type="primary" @click="initData()">查询</el-button>
    </div>
    <div class="_flex _font-title _flex-space-x _flex-start _cart _p5 _m-b-5">
      <div>基站总数：{{ missData.length }}</div>
      <div>
        正常基站：{{ missData.filter((item) => item.dataNum === 0).length }}
      </div>
      <div>
        异常基站：{{ missData.filter((item) => item.dataNum !== 0).length }}
      </div>
    </div>
    <div
      class="_cart _p5 _m-b-5 _wrapper-x"
      v-for="dataCheck in missData.filter((item) => item.dataNum != 0)"
      :key="dataCheck.code"
    >
      <div class="_font-title">
        {{ dataCheck.siteName }}({{ dataCheck.code }})_理想数据：{{
          dataCheck.shouldDataNum
        }}_ 缺失数据:{{ dataCheck.dataNum }}条_数据联通率：{{
          (dataCheck.dataIntegrity * 100).toFixed(2)
        }}%
      </div>
      <div class="_flex _flex-wrap _flex-start _flex-space">
        <div v-for="item in dataCheck.missTimes" :key="item">
          <el-button type="warning">{{ item }}</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import toolAction from "@/tool/http/tool-action";

export default {
  data() {
    return {
      siteMn: "",
      dayNum: 7,
      missData: [],
    };
  },
  mounted() {
    if (this.comCode) {
      this.siteMn = this.comCode;
      this.initData();
    }
  },
  methods: {
    initData() {
      toolAction
        .run("action-fm-data-check", "1", {
          mn: this.siteMn,
          dayNum: this.dayNum,
        })
        .then((res) => {
          this.missData = res;
        });
    },
  },
};
</script>
<style lang=""></style>
